3.4.5 \(\int (A+B \log (e (a+b x)^n (c+d x)^{-n}))^2 \, dx\) [305]

3.4.5.1 Optimal result
3.4.5.2 Mathematica [A] (verified)
3.4.5.3 Rubi [A] (verified)
3.4.5.4 Maple [C] (warning: unable to verify)
3.4.5.5 Fricas [F]
3.4.5.6 Sympy [F(-2)]
3.4.5.7 Maxima [F]
3.4.5.8 Giac [F]
3.4.5.9 Mupad [F(-1)]

3.4.5.1 Optimal result

Integrand size = 25, antiderivative size = 137 \[ \int \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\frac {2 B (b c-a d) n \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{b d}+\frac {(a+b x) \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2}{b}+\frac {2 B^2 (b c-a d) n^2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{b d} \]

output
2*B*(-a*d+b*c)*n*ln((-a*d+b*c)/b/(d*x+c))*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)) 
)/b/d+(b*x+a)*(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2/b+2*B^2*(-a*d+b*c)*n^2*p 
olylog(2,d*(b*x+a)/b/(d*x+c))/b/d
 
3.4.5.2 Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.58 \[ \int \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\frac {A^2 b d x-2 A B (b c-a d) n \log (c+d x)+2 A B d (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+B^2 d (a+b x) \log ^2\left (e (a+b x)^n (c+d x)^{-n}\right )+B^2 (b c-a d) n \left (-\log \left (\frac {b c-a d}{b c+b d x}\right ) \left (2 n \log \left (\frac {d (a+b x)}{-b c+a d}\right )-2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )+n \log \left (\frac {b c-a d}{b c+b d x}\right )\right )+2 n \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )}{b d} \]

input
Integrate[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2,x]
 
output
(A^2*b*d*x - 2*A*B*(b*c - a*d)*n*Log[c + d*x] + 2*A*B*d*(a + b*x)*Log[(e*( 
a + b*x)^n)/(c + d*x)^n] + B^2*d*(a + b*x)*Log[(e*(a + b*x)^n)/(c + d*x)^n 
]^2 + B^2*(b*c - a*d)*n*(-(Log[(b*c - a*d)/(b*c + b*d*x)]*(2*n*Log[(d*(a + 
 b*x))/(-(b*c) + a*d)] - 2*Log[(e*(a + b*x)^n)/(c + d*x)^n] + n*Log[(b*c - 
 a*d)/(b*c + b*d*x)])) + 2*n*PolyLog[2, (b*(c + d*x))/(b*c - a*d)]))/(b*d)
 
3.4.5.3 Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 130, normalized size of antiderivative = 0.95, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {2936, 2942, 2858, 27, 25, 2778, 2005, 2752}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2 \, dx\)

\(\Big \downarrow \) 2936

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{c+d x}dx}{b}\)

\(\Big \downarrow \) 2942

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (\frac {B n (b c-a d) \int \frac {\log \left (\frac {b c-a d}{b (c+d x)}\right )}{(a+b x) (c+d x)}dx}{d}-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2858

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (\frac {B n (b c-a d) \int \frac {d \log \left (\frac {b c-a d}{b (c+d x)}\right )}{(c+d x) \left (\left (a-\frac {b c}{d}\right ) d+b (c+d x)\right )}d(c+d x)}{d^2}-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (\frac {B n (b c-a d) \int -\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right )}{(c+d x) (b c-a d-b (c+d x))}d(c+d x)}{d}-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (-\frac {B n (b c-a d) \int \frac {\log \left (\frac {b c-a d}{b (c+d x)}\right )}{(c+d x) (b c-a d-b (c+d x))}d(c+d x)}{d}-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2778

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (\frac {B n (b c-a d) \int \frac {(c+d x) \log \left (\frac {b c-a d}{b (c+d x)}\right )}{b c-a d-b (c+d x)}d\frac {1}{c+d x}}{d}-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2005

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (\frac {B n (b c-a d) \int \frac {\log \left (\frac {b c-a d}{b (c+d x)}\right )}{\frac {b c-a d}{c+d x}-b}d\frac {1}{c+d x}}{d}-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}\right )}{b}\)

\(\Big \downarrow \) 2752

\(\displaystyle \frac {(a+b x) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )^2}{b}-\frac {2 B n (b c-a d) \left (-\frac {\log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{d}-\frac {B n \operatorname {PolyLog}\left (2,1-\frac {b c-a d}{b (c+d x)}\right )}{d}\right )}{b}\)

input
Int[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2,x]
 
output
((a + b*x)*(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])^2)/b - (2*B*(b*c - a*d 
)*n*(-((Log[(b*c - a*d)/(b*(c + d*x))]*(A + B*Log[(e*(a + b*x)^n)/(c + d*x 
)^n]))/d) - (B*n*PolyLog[2, 1 - (b*c - a*d)/(b*(c + d*x))])/d))/b
 

3.4.5.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2005
Int[(Fx_)*(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[x^(m 
+ n*p)*(b + a/x^n)^p*Fx, x] /; FreeQ[{a, b, m, n}, x] && IntegerQ[p] && Neg 
Q[n]
 

rule 2752
Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLo 
g[2, 1 - c*x], x] /; FreeQ[{c, d, e}, x] && EqQ[e + c*d, 0]
 

rule 2778
Int[((a_.) + Log[(c_.)*(x_)^(n_)]*(b_.))/((x_)*((d_) + (e_.)*(x_)^(r_.))), 
x_Symbol] :> Simp[1/n   Subst[Int[(a + b*Log[c*x])/(x*(d + e*x^(r/n))), x], 
 x, x^n], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IntegerQ[r/n]
 

rule 2858
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_ 
.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))^(r_.), x_Symbol] :> Simp[1/e   Subst[In 
t[(g*(x/e))^q*((e*h - d*i)/e + i*(x/e))^r*(a + b*Log[c*x^n])^p, x], x, d + 
e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - 
d*g, 0] && (IGtQ[p, 0] || IGtQ[r, 0]) && IntegerQ[2*r]
 

rule 2936
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))^(p_.), x_Symbol] :> Simp[(a + b*x)*((A + B*Log[e*((a + b*x)^n/(c 
+ d*x)^n)])^p/b), x] - Simp[B*n*p*((b*c - a*d)/b)   Int[(A + B*Log[e*((a + 
b*x)^n/(c + d*x)^n)])^(p - 1)/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, A, 
 B, n}, x] && EqQ[n + mn, 0] && NeQ[b*c - a*d, 0] && IGtQ[p, 0]
 

rule 2942
Int[((A_.) + Log[(e_.)*((a_.) + (b_.)*(x_))^(n_.)*((c_.) + (d_.)*(x_))^(mn_ 
)]*(B_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(-Log[-(b*c - a*d)/(d*(a 
+ b*x))])*((A + B*Log[e*((a + b*x)^n/(c + d*x)^n)])/g), x] + Simp[B*n*((b*c 
 - a*d)/g)   Int[Log[-(b*c - a*d)/(d*(a + b*x))]/((a + b*x)*(c + d*x)), x], 
 x] /; FreeQ[{a, b, c, d, e, f, g, A, B, n}, x] && EqQ[n + mn, 0] && NeQ[b* 
c - a*d, 0] && EqQ[b*f - a*g, 0]
 
3.4.5.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 4.85 (sec) , antiderivative size = 2240, normalized size of antiderivative = 16.35

method result size
risch \(\text {Expression too large to display}\) \(2240\)

input
int((A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))^2,x,method=_RETURNVERBOSE)
 
output
-2*n^2*B^2*c/d+(-2*x*B^2*ln((b*x+a)^n)-B*(-I*B*Pi*b*d*x*csgn(I*e)*csgn(I*( 
b*x+a)^n/((d*x+c)^n))*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)+I*B*Pi*b*d*x*csgn(I* 
e)*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2-I*B*Pi*b*d*x*csgn(I*(b*x+a)^n)*csgn(I 
/((d*x+c)^n))*csgn(I*(b*x+a)^n/((d*x+c)^n))+I*B*Pi*b*d*x*csgn(I*(b*x+a)^n) 
*csgn(I*(b*x+a)^n/((d*x+c)^n))^2+I*B*Pi*b*d*x*csgn(I/((d*x+c)^n))*csgn(I*( 
b*x+a)^n/((d*x+c)^n))^2-I*B*Pi*b*d*x*csgn(I*(b*x+a)^n/((d*x+c)^n))^3+I*B*P 
i*b*d*x*csgn(I*(b*x+a)^n/((d*x+c)^n))*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2-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left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2} \,d x } \]

input
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="fricas")
 
output
integral(B^2*log((b*x + a)^n*e/(d*x + c)^n)^2 + 2*A*B*log((b*x + a)^n*e/(d 
*x + c)^n) + A^2, x)
 
3.4.5.6 Sympy [F(-2)]

Exception generated. \[ \int \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\text {Exception raised: HeuristicGCDFailed} \]

input
integrate((A+B*ln(e*(b*x+a)**n/((d*x+c)**n)))**2,x)
 
output
Exception raised: HeuristicGCDFailed >> no luck
 
3.4.5.7 Maxima [F]

\[ \int \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\int { {\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2} \,d x } \]

input
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="maxima")
 
output
2*A*B*x*log((b*x + a)^n*e/(d*x + c)^n) + A^2*x + B^2*((2*b*c*n^2*log(b*x + 
 a)*log(d*x + c) - b*c*n^2*log(d*x + c)^2 + b*d*x*log((b*x + a)^n)^2 + b*d 
*x*log((d*x + c)^n)^2 + 2*(a*d*n*log(b*x + a) - b*c*n*log(d*x + c) + b*d*x 
*log(e))*log((b*x + a)^n) - 2*(a*d*n*log(b*x + a) - b*c*n*log(d*x + c) + b 
*d*x*log((b*x + a)^n) + b*d*x*log(e))*log((d*x + c)^n))/(b*d) - integrate( 
-(b^2*d*x^2*log(e)^2 + a*b*c*log(e)^2 - ((2*n*log(e) - log(e)^2)*b^2*c - ( 
2*n*log(e) + log(e)^2)*a*b*d)*x - 2*(b^2*c*n^2*x + 2*a*b*c*n^2 - a^2*d*n^2 
)*log(b*x + a))/(b^2*d*x^2 + a*b*c + (b^2*c + a*b*d)*x), x)) + 2*(a*e*n*lo 
g(b*x + a)/b - c*e*n*log(d*x + c)/d)*A*B/e
 
3.4.5.8 Giac [F]

\[ \int \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\int { {\left (B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A\right )}^{2} \,d x } \]

input
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))^2,x, algorithm="giac")
 
output
integrate((B*log((b*x + a)^n*e/(d*x + c)^n) + A)^2, x)
 
3.4.5.9 Mupad [F(-1)]

Timed out. \[ \int \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )^2 \, dx=\int {\left (A+B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\right )}^2 \,d x \]

input
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))^2,x)
 
output
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))^2, x)